﻿namespace SocketCore.Network
{
    public enum PackageTypeEnum
    {
        /// <summary>
        /// String package
        /// </summary>
        Ascii = 0,
        /// <summary>
        /// Memory stream package
        /// </summary>
        Bitmap = 1,
        /// <summary>
        /// Serialize package
        /// </summary>
        MemoryStream = 2,
        /// <summary>
        /// Bitmap package
        /// </summary>
        Serialize = 3,
        /// <summary>
        /// Binary package. i.e. : byte[]
        /// </summary>
        Binary = 4,
        /// <summary>
        /// Binary package. i.e. : file
        /// </summary>
        File = 5,
        /// <summary>
        /// Keep alive
        /// </summary>
        Heartbeat = 6
    }

    public class Message
    {
        public PackageTypeEnum Type
        {
            get;
            set;
        }

        public object Data
        {
            get;
            set;
        }

        public bool IsInternal
        {
            get;
            set;
        }

        public Message(PackageTypeEnum type, bool bInternal, object data)
        {
            Type = type;
            IsInternal = bInternal;
            Data = data;
        }
    }
}
